# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fang
pkgver=22.4f94552
pkgrel=4
groups=('blackarch' 'blackarch-cracker')
pkgdesc='A multi service threaded MD5 cracker.'
arch=('any')
url='https://github.com/evilsocket/fang'
license=('GPL2')
makedepends=('git')
depends=('python2')
source=("git+https://github.com/evilsocket/$pkgname.git")
sha512sums=('SKIP')
backup=('etc/fang.conf')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  # Fix file location.
  sed -i 's|fang\.conf|/etc/fang.conf|' "$pkgname.py"

  sed -i 's|python$|python2|' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 "$pkgname.conf" "$pkgdir/etc/$pkgname.conf"
}

